<?php /* @author SH1 */ ?>
<!--<?php echo $userinfo;
      echo $lv;
?>-->
<?php if($userinfo&&$lv==1):?>
<ul class="admin_actions">
    <li><a href="/study/shis/news/"><i class="icon-document-edit"></i> 新しい記事を書く</a></li>
</ul>


<ul class="blog_post_list">
<?php foreach ($post_list as $post_entry):?>
<?php //debug($post_entry);?>
    <li>
        <a class="post_link" href="<?php echo SHI_URL;?>/detail/<?php echo $post_entry['id'];?>">
        <div class="post">
            <h1><?php echo $post_entry['title'];?></h1>
            <span class="date"><?php echo $post_entry['created'];?></span>
            <p>
                <?php echo $post_entry['body'];?>
            </p>
        </div>
        </a>
        <?php if($userinfo):?>
        <ul class="admin_actions">
        <li>
        <?php echo $this->Html->link(
                '<i class="icon-document-edit"></i> 記事を編集',
                array('action' => 'edit', $post_entry['id']),
                array('escape'=>false));
        ?>
        </li>
        <li>
        <?php echo $this->Form->postLink(
                '<i class="icon-trash"></i> 記事を削除',
                array('action' => 'delete', $post_entry['id']),
                array('escape'=>false,'confirm' => 'Are you sure?'));
        ?>
        </li>
        </ul>
        <?php endif; ?>
    </li>


<?php endforeach;?>
<?php endif; ?>


<?php if(empty($userinfo)): ?>
<ul class="admin_actions">
    <li><a href="/study/shis/login"><i class="icon-document-edit"></i> ログイン</a></li>
</ul>

<ul class="blog_post_list">

<?php foreach ($post_list as $post_entry):?>
<?php //debug($post_entry);?>
    <li>
        <a class="post_link" href="<?php echo SHI_URL;?>/detail/<?php echo $post_entry['id'];?>">
        <div class="post">
            <h1><?php echo $post_entry['title'];?></h1>
            <span class="date"><?php echo $post_entry['created'];?></span>
            <p>
                <?php echo $post_entry['body'];?>
            </p>
        </div>
        </a>
    </li>
<?php endforeach;?>
<?php endif; ?>

<?php if(!empty($userinfo)&&$reg==1): ?>
<ul class="admin_actions">
    <li><a href="/study/shis">Jay Blog</a>へ　ようこそ！</li>
</ul>
<ul class="blog_post_list">

<?php foreach ($post_list as $post_entry):?>
<?php //debug($post_entry);?>
    <li>
        <a class="post_link" href="<?php echo SHI_URL;?>/detail/<?php echo $post_entry['id'];?>">
        <div class="post">
            <h1><?php echo $post_entry['title'];?></h1>
            <span class="date"><?php echo $post_entry['created'];?></span>
            <p>
                <?php echo $post_entry['body'];?>
            </p>
        </div>
        </a>
    </li>
<?php endforeach;?>
<?php endif; ?>

<?php if(!empty($userinfo)&&$reg==0): ?>
<ul class="admin_actions">
    <li>認証手続きを行ってから。<a href="/jp/login"><i class="icon-document-edit"></i> ログイン</a>してください。</li>
</ul>
<ul class="blog_post_list">

<?php foreach ($post_list as $post_entry):?>
<?php //debug($post_entry);?>
    <li>
        <a class="post_link" href="<?php echo SHI_URL;?>/detail/<?php echo $post_entry['id'];?>">
        <div class="post">
            <h1><?php echo $post_entry['title'];?></h1>
            <span class="date"><?php echo $post_entry['created'];?></span>
            <p>
                <?php echo $post_entry['body'];?>
            </p>
        </div>
        </a>
    </li>
<?php endforeach;?>
<?php endif; ?>




<div class="cbox pager">
    <ul>
        <li><a href=""><i class="icon-chevron-left"></i></a></li>
        <li><a href="">1</a></li>
        <li><a href="">2</a></li>
        <li><a href="">3</a></li>
        <li><a href=""><i class="icon-chevron-right"></i></a></li>
    </ul>
</div>